import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/LoginView.vue'
import DashboardView from '@/views/DashboardView.vue'
import UserManage from '@/views/UserManage.vue'
import UserDetail from '@/views/UserDetail.vue'
import Activity from '@/views/Activity.vue'
import AddOrUpdateActivity from '@/views/AddOrUpdateActivity.vue'
import ActivityDetail from '@/views/ActivityDetail.vue'
import ClueView from '@/views/ClueView.vue'
import AddOrUpdateClue from '@/views/AddOrUpdateClue.vue'
import ClueDetail from '@/views/ClueDetail.vue'
import CustomerView from '@/views/CustomerView.vue'
import StatisticView from '@/views/StatisticView.vue'
import CustomerDetail from '@/views/CustomerDetail.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: LoginView,
    },
    {
      path: '/dashboard',
      name: "dashboard",
      component: DashboardView,
      children: [
        {
          path: "",
          component: StatisticView,
          name: 'statisticView',
        },
        {
          path: "user",
          component: UserManage,
          name: 'userManage',
        },
        {
          path: "detail/:id",
          component: UserDetail,
          name: 'userDetail',
        },
        {
          path: "activity",
          component: Activity,
          name: 'activity',
        },
        {
          path: "activity/add",
          component: AddOrUpdateActivity,
          name: "addActivity"
        },
        {
          path: "activity/edit/:id",
          component: AddOrUpdateActivity,
          name: "editActivity"
        },
        {
          path: "activity/detail/:id",
          component: ActivityDetail,
          name: "activityDetail"
        },
        {
          path: "clue",
          component: ClueView,
          name: "clue"
        },
        {
          path: "clue/add",
          component: AddOrUpdateClue,
          name: "addClue"
        },
        {
          path: "clue/edit/:id",
          component: AddOrUpdateClue,
          name: "editClue"
        },
        {
          path: "clue/info/:id",
          component: ClueDetail,
          name: "clueInfo"
        },
        {
          path: "customer",
          component: CustomerView,
          name: "customer"
        },
        {
          path: "customer/info/:id",
          component: CustomerDetail,
          name: "customerInfo"
        }
      ]
    },


  ],
})

export default router
